/*
The MIT License (MIT)

Copyright (c) 2013 Mike Dapiran, Brian May, Richard Pospesel, and Bert Wierenga

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#pragma once


#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

namespace hhd
{
    namespace Input
    {
        // state of a digital button (keyboard key, xbox button, mouse button)
        enum KeyState
        {
            Pressed = 1,
            Released= 2,
            Changed=4,
            Unchanged=8
        };

        typedef KeyState ButtonState;

        // controllers enumerated
        enum XBoxController 
		{
			Controller1 = 0,
			Controller2 = 1,
			Controller3 = 2,
			Controller4 = 3
		};

        // xbox buttons enumerated
        enum XBoxButton
		{
			DPadUp = 0,
			DPadDown = 1,
			DPadLeft = 2,
			DPadRight = 3,
			Start = 4,
			Back = 5,
			LeftThumb = 6,
			RightThumb = 7,
			LeftShoulder = 8,
			RightShulder = 9,
			XBoxA = 10,
			XBoxB = 11,
			XBoxX = 12,
			XBoxY = 13
		};

        // xbox triggers enumerated
        enum XBoxTrigger
		{
			LeftTrigger = 0,
			RightTrigger = 1
		};

        // xbox joystick enumerated
        enum XBoxJoystick 
		{
			LeftX = 0,
			LeftY = 1,
			RightX = 2,
			RightY = 3
		};

        // mouse buttons enumerated
        enum MouseButton
		{
			Mouse1 = 0,
			Mouse2 = 1,
			Mouse3 = 2,
			Mouse4 = 3,
			Mouse5 = 4,
			Mouse6 = 5,
			Mouse7 = 6,
			Mouse8 = 7
		};
        
		// enumerated keyboard keys
        enum Key
        {
            Num0 = DIK_0,
            Num1 = DIK_1,
            Num2 = DIK_2,
            Num3 = DIK_3,
            Num4 = DIK_4,
            Num5 = DIK_5,
            Num6 = DIK_6,
            Num7 = DIK_7,
            Num8 = DIK_8,
            Num9 = DIK_9,
            A = DIK_A,
            B = DIK_B,
            C = DIK_C,
            D = DIK_D,
            E = DIK_E,
            F = DIK_F,
            G = DIK_G,
            H = DIK_H,
            I = DIK_I,
            J = DIK_J,
            K = DIK_K,
            L = DIK_L,
            M = DIK_M,
            N = DIK_N,
            O = DIK_O,
            P = DIK_P,
            Q = DIK_Q,
            R = DIK_R,
            S = DIK_S,
            T = DIK_T,
            U = DIK_U,
            V = DIK_V,
            W = DIK_W,
            X = DIK_X,
            Y = DIK_Y,
            Z = DIK_Z,
            Escape = DIK_ESCAPE,
            Tab = DIK_TAB,
            CapsLock = DIK_CAPITAL,
            LeftShift = DIK_LSHIFT,
            RightShift = DIK_RSHIFT,
            LeftControl = DIK_LCONTROL,
            RightControl = DIK_RCONTROL,
            LeftWindows = DIK_LWIN,
            RightWindows = DIK_RWIN,
            LeftAlt = DIK_LALT,
            RightAlt = DIK_RALT,
            Space = DIK_SPACE,
            Enter = DIK_RETURN,
            Backspace = DIK_BACKSPACE,
            LeftArrow = DIK_LEFTARROW,
            UpArrow = DIK_UPARROW,
            RightArrow = DIK_RIGHTARROW,
            DownArrow = DIK_DOWNARROW
        };
    }
}
